package com.thread.test09.hw2;

/**
 * @author bin
 * @date 2025 - 03 -11
 **/
public class MyThread extends Thread{
    private int count = 50;

    public MyThread() {
    }

    public MyThread(String name) {
        super(name);
    }

    @Override
    public void run() {
        while(true){

            if(count > 0){
                System.out.println(getName()+"剩余票数：" + count--);
            }
            else{
                System.out.println("电影票已经卖完了");;
                break;
            }
        }
    }
}
